﻿using System;
using System.Collections.Generic;
using System.Data;
using ThangNM_LIB.FUNC;

namespace EntityObject
{
    [Serializable()]
    public class FacebookEO
    {
        public class User   //100003132547777 (v2.0 -> v2,3)
        {
            public String id { get; set; }
            public String first_name { get; set; }
            public String last_name { get; set; }
            public String link { get; set; }
            public String middle_name { get; set; }
            public String name { get; set; }
            public Int16 timezone { get; set; }
            public String updated_time { get; set; }
            public Boolean verified { get; set; }

            public String category { get; set; }
            public Facebook_EXEO.User.accounts accounts { get; set; }
        }

        public class Page   //262997240494205 (v2.0 -> v2,3)
        {
            public String id { get; set; }
            public String about { get; set; }
            public String birthday { get; set; }
            public Boolean can_post { get; set; }
            public String category { get; set; }
            public Int32 checkins { get; set; }
            public Int32 country_page_likes { get; set; }

            public Facebook_EXEO.Page.cover cover { get; set; }

            public String description { get; set; }
            public Boolean has_added_app { get; set; }
            public Boolean is_community_page { get; set; }
            public Boolean is_published { get; set; }
            public Int32 new_like_count { get; set; }
            public Int32 likes { get; set; }
            public String link { get; set; }
            public String name { get; set; }
            public String name_with_location_descriptor { get; set; }
            public Boolean offer_eligible { get; set; }

            public Facebook_EXEO.Page.parking parking { get; set; }

            public Boolean promotion_eligible { get; set; }
            public Int32 talking_about_count { get; set; }
            public Int32 unread_message_count { get; set; }
            public Int32 unread_notif_count { get; set; }
            public Int32 unseen_message_count { get; set; }
            public String username { get; set; }
            public String website { get; set; }
            public Int32 were_here_count { get; set; }
        }

        public class Group
        {
            public String description { get; set; }
            public String email { get; set; }
            public String icon { get; set; }
            public String name { get; set; }
            public String privacy { get; set; }
            public String updated_time { get; set; }
            public String id { get; set; }
        }

        public class Feed   //262997240494205/feed?fields=parent_id,object_id,type
        {
            public List<Facebook_EXEO.Feed.data> data { get; set; }
            public Facebook_EXEO.Page_Size.paging paging { get; set; }
        }

        public class Post   //944845575629852
        {
            public String id { get; set; }
            public User from { get; set; }
            public String message { get; set; }
            public String updated_time { get; set; }

            public Likes likes { get; set; }

            public Comments comments { get; set; }
        }

        public class Link
        {
            public String updated_time { get; set; }
            public String created_time { get; set; }
            public String message { get; set; }
            public String id { get; set; }
        }

        public class Event
        {
            public String updated_time { get; set; }
            public String created_time { get; set; }
            public String story { get; set; }
            public String id { get; set; }
        }

        public class Offer
        {
            public String updated_time { get; set; }
            public String created_time { get; set; }
            public String message { get; set; }
            public String story { get; set; }
            public String id { get; set; }
        }

        public class Photo
        {
            public String id { get; set; }
            public String created_time { get; set; }

            public User from { get; set; }
            public Int32 height { get; set; }
            public String icon { get; set; }

            public List<Facebook_EXEO.Photo.images> images { get; set; }

            public String link { get; set; }
            public String picture { get; set; }
            public String source { get; set; }
            public String updated_time { get; set; }
            public Int32 width { get; set; }

            public Facebook_EXEO.Photo.tags tags { get; set; }

            public Likes likes { get; set; }

            public Comments comments { get; set; }
        }

        public class Video
        {
            public String description { get; set; }
            public String updated_time { get; set; }
            public String backdated_time { get; set; }
            public String backdated_time_granularity { get; set; }

            public Comments comments { get; set; }

            public String created_time { get; set; }
            public String embed_html { get; set; }
            public List<Facebook_EXEO.Videos.format> format { get; set; }

            public User from { get; set; }

            public String icon { get; set; }
            public String name { get; set; }
            public String picture { get; set; }
            public Facebook_EXEO.Videos.place place { get; set; }
            public String source { get; set; }
            public Boolean published { get; set; }
            public Boolean embeddable { get; set; }
            public Boolean copyrighted { get; set; }
            public String id { get; set; }

            public Likes likes { get; set; }
        }

        public class Note
        {
            public String updated_time { get; set; }
            public String created_time { get; set; }
            public String message { get; set; }
            public String story { get; set; }
            public String id { get; set; }
            public User from { get; set; }

            public Likes likes { get; set; }

            public Comments comments { get; set; }
        }

        public class Comments
        {
            public List<Facebook_EXEO.Comments.data> data { get; set; }
            public Facebook_EXEO.Page_Size.paging paging { get; set; }
        }

        public class Likes
        {
            public List<Facebook_EXEO.Likes.data> data { get; set; }
            public Facebook_EXEO.Page_Size.paging paging { get; set; }
        }

        public class Token
        {
            public String access_token { get; set; }
            public String token_type { get; set; }
            public String expires_in { get; set; }
        }
    }

    [Serializable()]
    public class Facebook_EXEO
    {
        public class User
        {
            public class accounts
            {
                public List<User_accounts_data> data { get; set; }
                public Page_Size.paging paging { get; set; }
            }

            public class User_accounts_data
            {
                public String access_token { get; set; }
                public String category { get; set; }
                public String name { get; set; }
                public String id { get; set; }
                public List<String> perms { get; set; }
            }
        }

        public class Page
        {
            public class parking
            {
                public Int32 lot { get; set; }
                public Int32 street { get; set; }
                public Int32 valet { get; set; }
            }

            public class cover
            {
                public String cover_id { get; set; }
                public Int32 offset_x { get; set; }
                public Int32 offset_y { get; set; }
                public String source { get; set; }
                public String id { get; set; }
            }
        }

        public class Feed
        {
            public class data
            {
                public String id { get; set; }
                public String object_id { get; set; }
                public String type { get; set; }    //link, status, photo, video, event, offer
            }
        }

        public class Post
        {

        }

        public class Photo
        {
            public class images
            {
                public Int32 height { get; set; }
                public String source { get; set; }
                public Int32 width { get; set; }
            }

            public class tags
            {
                public List<tags_data> data { get; set; }
            }

            public class tags_data
            {
                public String id { get; set; }
                public String name { get; set; }
                public String created_time { get; set; }
                public Decimal x { get; set; }
                public Decimal y { get; set; }
            }
        }

        public class Videos
        {
            public class format
            {
                public String embed_html { get; set; }
                public String filter { get; set; }
                public Int32 height { get; set; }
                public String picture { get; set; }
                public Int32 width { get; set; }
            }

            public class place
            {
                public String name { get; set; }
                public location location { get; set; }
                public String id { get; set; }
            }

            public class location
            {
                public String city { get; set; }
                public String country { get; set; }
                public Decimal latitude { get; set; }
                public Decimal longitude { get; set; }
            }
        }

        public class Comments
        {
            public class data
            {
                public String created_time { get; set; }
                public FacebookEO.User from { get; set; }
                //public FacebookAPI.User from { get; set; }
                public String message { get; set; }
                public Boolean can_remove { get; set; }
                public Int32 like_count { get; set; }
                public List<message_tags> message_tags { get; set; }
                public Boolean user_likes { get; set; }
                public String id { get; set; }
                public Int32 comment_count { get; set; }
            }

            public class message_tags
            {
                public String id { get; set; }
                public Int32 length { get; set; }
                public String name { get; set; }
                public Int32 offset { get; set; }
                public String type { get; set; }
            }
        }

        public class Likes
        {
            public class data
            {
                public Boolean can_post { get; set; }
                public String id { get; set; }
                public String link { get; set; }
                public String name { get; set; }
                public String profile_type { get; set; }
                public String username { get; set; }
                public String pic { get; set; }
                public String pic_crop { get; set; }
                public String pic_large { get; set; }
                public String pic_small { get; set; }
                public String pic_square { get; set; }
                public picture picture { get; set; }
            }

            public class picture
            {
                public String height { get; set; }
                public Boolean is_silhouette { get; set; }
                public String url { get; set; }
                public String width { get; set; }
            }
        }

        public class Page_Size
        {
            //public class paging_ex
            //{
            //    public cursors cursors { get; set; }
            //}

            //public class cursors
            //{
            //    public String before { get; set; }
            //    public String after { get; set; }
            //}

            public class paging
            {
                public String previous { get; set; }
                public String next { get; set; }
            }
        }
    }

    [Serializable()]
    public class FBEO
    {
        public Boolean isNextPage { get; set; }
        public String strQuery { get; set; }
        public String strJson { get; set; }


        public UserEO _UserEO { get; set; }
        public OptionEO _OptionEO { get; set; }
        public Facebook_EXEO.User.accounts objFB_User_accounts { get; set; }
        public FacebookEO.User objFB_User { get; set; }
        public FacebookEO.Page objFB_Page { get; set; }
        public FacebookEO.Group objFB_Group { get; set; }
        public PageEO _PageEO { get; set; }

        public FacebookEO.Feed objFB_Feed { get; set; }
        public PostEO _PostEO { get; set; }
        public FacebookEO.Post objFB_Post { get; set; }
        public FacebookEO.Photo objFB_Photo { get; set; }
        public FacebookEO.Video objFB_Video { get; set; }
        public FacebookEO.Link objFB_Link { get; set; }
        public FacebookEO.Event objFB_Event { get; set; }
        public FacebookEO.Offer objFB_Offer { get; set; }
        public FacebookEO.Note objFB_Note { get; set; }
        public FacebookEO.Comments objFB_Comment { get; set; }
        public CommentEO _CommentEO { get; set; }
        public List<CommentEO> lstCommentEO { get; set; }
        public List<PostEO> lstPostEO { get; set; }
        public FacebookEO.Comments objFB_Reply { get; set; }
        public LikeEO _LikeEO { get; set; }
        public List<LikeEO> lstLikeEO { get; set; }
        public FacebookEO.Likes objFB_Like { get; set; }
        public FacebookEO.Token objFB_Token { get; set; }
        public DataTable dtBulk { get; set; }
    }

    [Serializable()]
    public class FacebookOptionEO
    {
        public Int16 type { get; set; }
        public String name { get; set; }
        public String id_user_page_group { get; set; }
        public String id_status_photo_video_link_event_offer_note { get; set; }
        public String id_comment { get; set; }
        public Boolean isGetPost { get; set; }
        public Boolean isGetLike { get; set; }
        public Boolean isGetComment { get; set; }
        public Boolean isGetReply { get; set; }
        public Boolean isGetEmail { get; set; }
        public Boolean isSQLite { get; set; }

        public FacebookOptionEO(Int16 _type, String _name, String _id_user_page_group, String _id_status_link_photo_video_event_offer_note, String _id_comment, Boolean _isGetPost, Boolean _isGetLike, Boolean _isGetComment, Boolean _isGetReply, Boolean _isGetEmail, Boolean _isSQLite)
        {
            this.type = _type;
            this.name = _name;
            this.id_user_page_group = StringEx.Trim(_id_user_page_group);
            this.id_status_photo_video_link_event_offer_note = StringEx.Trim(_id_status_link_photo_video_event_offer_note);
            this.id_comment = StringEx.Trim(_id_comment);
            this.isGetPost = _isGetPost;
            this.isGetLike = _isGetLike;
            this.isGetComment = _isGetComment;
            this.isGetReply = _isGetReply;
            this.isGetEmail = _isGetEmail;
            this.isSQLite = _isSQLite;
        }

        public FacebookOptionEO(Int16 _type, String _name, String _id_user_page_group, String _id_status_link_photo_video_event_offer_note, String _id_comment, FacebookOptionEO _FacebookOptionEO)
        {
            this.type = _type;
            this.name = _name;
            this.id_user_page_group = StringEx.Trim(_id_user_page_group);
            this.id_status_photo_video_link_event_offer_note = StringEx.Trim(_id_status_link_photo_video_event_offer_note);
            this.id_comment = StringEx.Trim(_id_comment);
            this.isGetPost = _FacebookOptionEO.isGetPost;
            this.isGetLike = _FacebookOptionEO.isGetLike;
            this.isGetComment = _FacebookOptionEO.isGetComment;
            this.isGetReply = _FacebookOptionEO.isGetReply;
            this.isGetEmail = _FacebookOptionEO.isGetEmail;
            this.isSQLite = _FacebookOptionEO.isSQLite;
        }

        public FacebookOptionEO(Int16 _type)
        {
            this.type = _type;
        }

        public FacebookOptionEO()
        {
        }
    }
}